/*
 * Copyright (c) 2021 MediaTek Inc.
 *
 * Use of this source code is governed by a MIT-style
 * license that can be found in the LICENSE file or at
 * https://opensource.org/licenses/MIT
 */

#pragma once

#define ERR_MOD_SHIFT           (20)
#define ERR_LV1_SHIFT           (12)
#define MAKE_ERR_MOD_LV1_BASE(mod, lv1_err) ((mod << ERR_MOD_SHIFT) | \
                          (lv1_err << ERR_LV1_SHIFT))

#define ERR_MOD_SECURITY_ID     (0x00000001)

#define MOD_ID                  ERR_MOD_SECURITY_ID

#define ERR_VB_LV1_GENERAL      (0x0000)
#define ERR_VB_LV1_AUTH         (0x0001)
#define ERR_VB_LV1_CRYPTO       (0x0002)
#define ERR_VB_LV1_SECCFG       (0x0003)
#define ERR_VB_LV1_ANTIROLLBACK (0x0004)
#define ERR_VB_LV1_REGION       (0x0005)
#define ERR_VB_LV1_TRNG         (0x0006)
#define ERR_VB_LV1_VBSTATE      (0x0007)
#define ERR_VB_LV1_AVB          (0x0008)
#define ERR_VB_LV1_PL           (0x0009)
#define ERR_VB_LV1_FASTBOOT     (0x000A)
#define ERR_VB_LV1_OAEP         (0x000B)

/* MOD: offset: 20
 * MOD_LV1: offset: 12
 * MOD_LV2: offset: 0
 * for MOD = 0x01, MOD_LV1 = 0x02, MOD_LV2 = 0x03, error code
 * would be 0x0010_2003
 */

/* 0x0010_0000 */
#define ERR_VB_GENERAL_BASE      (MAKE_ERR_MOD_LV1_BASE(MOD_ID, ERR_VB_LV1_GENERAL))
/* 0x0010_1000 */
#define ERR_VB_AUTH_BASE         (MAKE_ERR_MOD_LV1_BASE(MOD_ID, ERR_VB_LV1_AUTH))
/* 0x0010_2000 */
#define ERR_VB_CRYPTO_BASE       (MAKE_ERR_MOD_LV1_BASE(MOD_ID, ERR_VB_LV1_CRYPTO))
/* 0x0010_3000 */
#define ERR_VB_SECCFG_BASE       (MAKE_ERR_MOD_LV1_BASE(MOD_ID, ERR_VB_LV1_SECCFG))
/* 0x0010_4000 */
#define ERR_VB_ANTIROLLBACK_BASE (MAKE_ERR_MOD_LV1_BASE(MOD_ID, ERR_VB_LV1_ANTIROLLBACK))
/* 0x0010_5000 */
#define ERR_VB_REGION_BASE       (MAKE_ERR_MOD_LV1_BASE(MOD_ID, ERR_VB_LV1_REGION))
/* 0x0010_6000 */
#define ERR_VB_TRNG_BASE         (MAKE_ERR_MOD_LV1_BASE(MOD_ID, ERR_VB_LV1_TRNG))
/* 0x0010_7000 */
#define ERR_VB_STATE_BASE        (MAKE_ERR_MOD_LV1_BASE(MOD_ID, ERR_VB_LV1_VBSTATE))
/* 0x0010_8000 */
#define ERR_AVB_BASE             (MAKE_ERR_MOD_LV1_BASE(MOD_ID, ERR_VB_LV1_AVB))
/* 0x0010_9000 */
#define ERR_PL_INFO_BASE         (MAKE_ERR_MOD_LV1_BASE(MOD_ID, ERR_VB_LV1_PL))
/* 0x0010_A000 */
#define ERR_FB_SEC_BASE          (MAKE_ERR_MOD_LV1_BASE(MOD_ID, ERR_VB_LV1_FASTBOOT))
/* 0x0010_B000 */
#define ERR_OAEP_BASE            (MAKE_ERR_MOD_LV1_BASE(MOD_ID, ERR_VB_LV1_OAEP))

/* GENERAL */
#define ERR_VB_BUF_ADDR_INVALID           (ERR_VB_GENERAL_BASE + 0x000) //0x00100000
#define ERR_VB_BUF_OVERFLOW               (ERR_VB_GENERAL_BASE + 0x001) //0x00100001
#define ERR_VB_INVALID_IMG_SZ             (ERR_VB_GENERAL_BASE + 0x002) //0x00100002
#define ERR_VB_INVALID_IMG_ALIGN_SZ       (ERR_VB_GENERAL_BASE + 0x003) //0x00100003
#define ERR_VB_INVALID_PAGE_SZ            (ERR_VB_GENERAL_BASE + 0x004) //0x00100004
#define ERR_VB_INVALID_STRING             (ERR_VB_GENERAL_BASE + 0x005) //0x00100005
#define ERR_VB_INVALID_ADDR               (ERR_VB_GENERAL_BASE + 0x006) //0x00100006
#define ERR_VB_SEC_BUF_ALLOCATE_FAIL      (ERR_VB_GENERAL_BASE + 0x007) //0x00100007
#define ERR_VB_STORAGE_READ_FAIL          (ERR_VB_GENERAL_BASE + 0x008) //0x00100008
#define ERR_VB_INVALID_BUF_SZ             (ERR_VB_GENERAL_BASE + 0x009) //0x00100009
#define ERR_VB_INVALID_DEVICE             (ERR_VB_GENERAL_BASE + 0x00A) //0x0010000A
#define ERR_VB_INVALID_IO                 (ERR_VB_GENERAL_BASE + 0x00B) //0x0010000B

/* AUTH */
#define ERR_VB_CERT_OBJ_ID_MISMATCH       (ERR_VB_AUTH_BASE + 0x000) //0x00101000
#define ERR_VB_CERT_OBJ_LEN_MISMATCH      (ERR_VB_AUTH_BASE + 0x001) //0x00101001
#define ERR_VB_CERT_TRAVERSE_MODE_UNKNOWN (ERR_VB_AUTH_BASE + 0x002) //0x00101002
#define ERR_VB_CERT_INVALID_OID_IDX       (ERR_VB_AUTH_BASE + 0x003) //0x00101003
#define ERR_VB_CERT_OID_NOT_FOUND         (ERR_VB_AUTH_BASE + 0x004) //0x00101004
#define ERR_VB_CERT_OBJ_NOT_FOUND         (ERR_VB_AUTH_BASE + 0x005) //0x00101005
#define ERR_VB_CERT_E_KEY_LEN_MISMATCH    (ERR_VB_AUTH_BASE + 0x006) //0x00101006
#define ERR_VB_CERT_E_KEY_MISMATCH        (ERR_VB_AUTH_BASE + 0x007) //0x00101007
#define ERR_VB_CERT_N_KEY_LEN_MISMATCH    (ERR_VB_AUTH_BASE + 0x008) //0x00101008
#define ERR_VB_CERT_N_KEY_MISMATCH        (ERR_VB_AUTH_BASE + 0x009) //0x00101009
#define ERR_VB_INVALID_OID_LEN            (ERR_VB_AUTH_BASE + 0x00A) //0x0010100A
#define ERR_VB_INVALID_OID_BUF_LEN        (ERR_VB_AUTH_BASE + 0x00B) //0x0010100B
#define ERR_VB_INVALID_OID_DER_SZ         (ERR_VB_AUTH_BASE + 0x00C) //0x0010100C
#define ERR_VB_UNEXPECTED_IMG_TYPE        (ERR_VB_AUTH_BASE + 0x00D) //0x0010100D
#define ERR_VB_IMG_INVALID_TYPE           (ERR_VB_AUTH_BASE + 0x00E) //0x0010100E
#define ERR_VB_IMG_NOT_FOUND              (ERR_VB_AUTH_BASE + 0x00F) //0x0010100F
#define ERR_VB_IMG_HDR_HASH_VFY_FAIL      (ERR_VB_AUTH_BASE + 0x010) //0x00101010
#define ERR_VB_IMG_HASH_VFY_FAIL          (ERR_VB_AUTH_BASE + 0x011) //0x00101011
#define ERR_VB_INVALID_IMG_HDR            (ERR_VB_AUTH_BASE + 0x012) //0x00101012
#define ERR_VB_INVALID_SIG_CONTENT        (ERR_VB_AUTH_BASE + 0x013) //0x00101013
#define ERR_VB_INVALID_SOCID_LEN          (ERR_VB_AUTH_BASE + 0x014) //0x00101014
#define ERR_VB_SW_ID_MISMATCH             (ERR_VB_AUTH_BASE + 0x015) //0x00101015
#define ERR_VB_INVALID_SIG_LEN            (ERR_VB_AUTH_BASE + 0x016) //0x00101016
#define ERR_VB_PADDING_LEN_INVALID        (ERR_VB_AUTH_BASE + 0x017) //0x00101017
#define ERR_VB_UNSUPPORTED_SIG_TYPE       (ERR_VB_AUTH_BASE + 0x018) //0x00101018
#define ERR_VB_INVALID_CERT_SZ            (ERR_VB_AUTH_BASE + 0x019) //0x00101019
#define ERR_VB_INVALID_HASH_SZ            (ERR_VB_AUTH_BASE + 0x01A) //0x0010101A
#define ERR_VB_INVALID_SIG_SZ             (ERR_VB_AUTH_BASE + 0x01B) //0x0010101B
#define ERR_VB_PUBK_NOT_INITIALIZED       (ERR_VB_AUTH_BASE + 0x01C) //0x0010101C
#define ERR_VB_PUBK_AUTH_FAIL             (ERR_VB_AUTH_BASE + 0x01D) //0x0010101D
#define ERR_VB_INVALID_PUBK_SZ            (ERR_VB_AUTH_BASE + 0x01E) //0x0010101E
#define ERR_VB_DA_VFY_FAIL                (ERR_VB_AUTH_BASE + 0x01F) //0x0010101F
#define ERR_VB_DA_KEY_INIT_FAIL           (ERR_VB_AUTH_BASE + 0x020) //0x00101020
#define ERR_VB_DA_RELOCATE_LEN_NOT_ENOUGH (ERR_VB_AUTH_BASE + 0x021) //0x00101021
#define ERR_VB_SOCID_MISMATCH             (ERR_VB_AUTH_BASE + 0x022) //0x00101022
#define ERR_VB_SEC_LEVEL_UNSUPPORT        (ERR_VB_AUTH_BASE + 0x023) //0x00101023
#define ERR_VB_SEC_LEVEL_MISMATCH         (ERR_VB_AUTH_BASE + 0x024) //0x00101024
#define ERR_VB_SEC_LEVEL_OVERFLOW         (ERR_VB_AUTH_BASE + 0x025) //0x00101025
#define ERR_VB_PUBK_SZ_MISMATCH           (ERR_VB_AUTH_BASE + 0x026) //0x00101026
#define ERR_VB_PUBK_HASH_GROUP_INVALID    (ERR_VB_AUTH_BASE + 0x027) //0x00101027

/* CRYPTO */
#define ERR_VB_CRYPTO_HACC_MODE_INVALID     (ERR_VB_CRYPTO_BASE + 0x000) //0x00102000
#define ERR_VB_CRYPTO_HACC_KEY_LEN_INVALID  (ERR_VB_CRYPTO_BASE + 0x001) //0x00102001
#define ERR_VB_CRYPTO_HACC_DATA_UNALIGNED   (ERR_VB_CRYPTO_BASE + 0x002) //0x00102002
#define ERR_VB_CRYPTO_HACC_SEED_LEN_INVALID (ERR_VB_CRYPTO_BASE + 0x003) //0x00102003
#define ERR_VB_CRYPTO_HASH_FAIL             (ERR_VB_CRYPTO_BASE + 0x004) //0x00102004
#define ERR_VB_CRYPTO_RSA_PSS_CHK_FAIL      (ERR_VB_CRYPTO_BASE + 0x005) //0x00102005
#define ERR_VB_CRYPTO_RSA_SIG_CHK_FAIL      (ERR_VB_CRYPTO_BASE + 0x006) //0x00102006
#define ERR_VB_CRYPTO_HMAC_KEY_PTR_INVALID  (ERR_VB_CRYPTO_BASE + 0x007) //0x00102007
#define ERR_VB_CRYPTO_HMAC_KEY_LEN_INVALID  (ERR_VB_CRYPTO_BASE + 0x008) //0x00102008
#define ERR_VB_CRYPTO_HMAC_MSG_PTR_INVALID  (ERR_VB_CRYPTO_BASE + 0x009) //0x00102009
#define ERR_VB_CRYPTO_HMAC_MSG_LEN_INVALID  (ERR_VB_CRYPTO_BASE + 0x00a) //0x0010200A
#define ERR_VB_CRYPTO_HMAC_MAC_PTR_INVALID  (ERR_VB_CRYPTO_BASE + 0x00b) //0x0010200B
#define ERR_VB_CRYPTO_HMAC_HASH_FAIL        (ERR_VB_CRYPTO_BASE + 0x00c) //0x0010200C
#define ERR_VB_CRYPTO_GET_LCS_FAIL          (ERR_VB_CRYPTO_BASE + 0x00d) //0x0010200D
#define ERR_VB_CRYPTO_KEY_DERIVE_DUMMY      (ERR_VB_CRYPTO_BASE + 0x00e) //0x0010200E
#define ERR_VB_CRYPTO_KEY_DERIVE_FAIL       (ERR_VB_CRYPTO_BASE + 0x00f) //0x0010200F
#define ERR_VB_CRYPTO_SHA256_OP_FAIL        (ERR_VB_CRYPTO_BASE + 0x010) //0x00102010
#define ERR_VB_CRYPTO_ALLOCATE_MEM_FAIL     (ERR_VB_CRYPTO_BASE + 0x011) //0x00102011
#define ERR_VB_CRYPTO_INVALID_PARAMETER     (ERR_VB_CRYPTO_BASE + 0x012) //0x00102012
#define ERR_VB_CRYPTO_BUF_OVERFLOW          (ERR_VB_CRYPTO_BASE + 0x013) //0x00102013
#define ERR_VB_CRYPTO_MP_INIT_FAIL          (ERR_VB_CRYPTO_BASE + 0x014) //0x00102014
#define ERR_VB_CRYPTO_CHECK_MSB_FAIL        (ERR_VB_CRYPTO_BASE + 0x015) //0x00102015
#define ERR_VB_CRYPTO_CHECK_BD_FAIL         (ERR_VB_CRYPTO_BASE + 0x016) //0x00102016

/* SECCFG */
#define ERR_VB_SECCFG_NOT_FOUND           (ERR_VB_SECCFG_BASE + 0x000) //0x00103000
#define ERR_VB_SECCFG_STATUS_INVALID      (ERR_VB_SECCFG_BASE + 0x001) //0x00103001
#define ERR_VB_SECCFG_ERASE_FAIL          (ERR_VB_SECCFG_BASE + 0x002) //0x00103002
#define ERR_VB_SECCFG_WRITE_FAIL          (ERR_VB_SECCFG_BASE + 0x003) //0x00103003
#define ERR_VB_SECCFG_BUF_OVERFLOW        (ERR_VB_SECCFG_BASE + 0x004) //0x00103004
#define ERR_VB_SECCFG_INVALID_MAGIC       (ERR_VB_SECCFG_BASE + 0x005) //0x00103005
#define ERR_VB_LKS_SECCFG_FAIL            (ERR_VB_SECCFG_BASE + 0x006) //0x00103006
#define ERR_VB_LKS_CUSTOM_FAIL            (ERR_VB_SECCFG_BASE + 0x007) //0x00103007
#define ERR_VB_LKS_NOT_EQUAL              (ERR_VB_SECCFG_BASE + 0x008) //0x00103008

/* ANTI ROLLBACK */
#define ERR_VB_CERT_IMG_VER_NOT_SYNC      (ERR_VB_ANTIROLLBACK_BASE + 0x000) //0x00104000
#define ERR_VB_IMG_VER_ROLLBACK           (ERR_VB_ANTIROLLBACK_BASE + 0x001) //0x00104001
#define ERR_VB_IMG_VER_OVERFLOW           (ERR_VB_ANTIROLLBACK_BASE + 0x002) //0x00104002
#define ERR_VB_UNKNOWN_NV_CNT_GROUP       (ERR_VB_ANTIROLLBACK_BASE + 0x003) //0x00104003
#define ERR_VB_GET_NV_CNT_FAIL            (ERR_VB_ANTIROLLBACK_BASE + 0x004) //0x00104004
#define ERR_VB_WRITE_NV_CNT_FAIL          (ERR_VB_ANTIROLLBACK_BASE + 0x005) //0x00104005
#define ERR_VB_SW_VER_MISMATCH            (ERR_VB_ANTIROLLBACK_BASE + 0x006) //0x00104006
#define ERR_VB_INVALID_IMG_OTP_UNIT       (ERR_VB_ANTIROLLBACK_BASE + 0x007) //0x00104007
#define ERR_VB_INVALID_OTP_INDEX          (ERR_VB_ANTIROLLBACK_BASE + 0x008) //0x00104008
#define ERR_VB_INVALID_GROUP_IDX          (ERR_VB_ANTIROLLBACK_BASE + 0x009) //0x00104009
#define ERR_VB_INVALID_GROUP_NUM          (ERR_VB_ANTIROLLBACK_BASE + 0x00A) //0x0010400A
#define ERR_VB_SEC_VER_BUF_INIT_FAIL      (ERR_VB_ANTIROLLBACK_BASE + 0x00B) //0x0010400B
#define ERR_VB_SEC_OTP_TABLE_NOT_INIT     (ERR_VB_ANTIROLLBACK_BASE + 0x00C) //0x0010400C
#define ERR_VB_IMG_VER_UNDERFLOW          (ERR_VB_ANTIROLLBACK_BASE + 0x00D) //0x0010400D
#define ERR_VB_CERT_INVALID_VER_ID        (ERR_VB_ANTIROLLBACK_BASE + 0x00E) //0x0010400E
#define ERR_VB_INVALID_IMG_NAME           (ERR_VB_ANTIROLLBACK_BASE + 0x00F) //0x0010400F

/* REGION CHECK */
#define ERR_VB_REGION_INCLUDE             (ERR_VB_REGION_BASE + 0x000) //0x00105000
#define ERR_VB_REGION_OVERLAP             (ERR_VB_REGION_BASE + 0x001) //0x00105001
#define ERR_VB_REGION_OVERFLOW            (ERR_VB_REGION_BASE + 0x002) //0x00105002
#define ERR_VB_DA_ADDR_INVALID            (ERR_VB_REGION_BASE + 0x003) //0x00105003
#define ERR_VB_DA_LEN_INVALID             (ERR_VB_REGION_BASE + 0x004) //0x00105004
#define ERR_VB_INVALID_LOAD_ADDR          (ERR_VB_REGION_BASE + 0x005) //0x00105005
#define ERR_VB_INVALID_VER                (ERR_VB_REGION_BASE + 0x006) //0x00105006

/* TRNG */
#define ERR_VB_TRNG_WRITE_DATA_FAIL       (ERR_VB_TRNG_BASE + 0x000) //0x00106000

/* VBOOT STATE */
#define ERR_VB_STATE_PRINT_FAIL           (ERR_VB_STATE_BASE + 0x000) //0x00107000
#define ERR_VB_STATE_SHOW_WARNING_FAIL    (ERR_VB_STATE_BASE + 0x001) //0x00107001
#define ERR_VB_STATE_SET_CMDLINE_FAIL     (ERR_VB_STATE_BASE + 0x002) //0x00107002

/* AVB */
#define ERR_AVB_CMDLINE_ENTRY_NOT_FOUND   (ERR_AVB_BASE + 0x000) //0x00108000
#define ERR_AVB_INVALID_KEY_BUF           (ERR_AVB_BASE + 0x001) //0x00108001
#define ERR_AVB_INVALID_OUTPUT_BUF        (ERR_AVB_BASE + 0x002) //0x00108002
#define ERR_AVB_INVALID_VALUE_SZ          (ERR_AVB_BASE + 0x003) //0x00108003
#define ERR_AVB_INVALID_INPUT_BUF         (ERR_AVB_BASE + 0x004) //0x00108004
#define ERR_AVB_INVALID_CMDLINE_FMT       (ERR_AVB_BASE + 0x005) //0x00108005
#define ERR_AVB_CMDLINE_OVERFLOW          (ERR_AVB_BASE + 0x006) //0x00108006
#define ERR_AVB_UNLOCK_DEVICE_FAILED      (ERR_AVB_BASE + 0x007) //0x00108007
#define ERR_AVB_SET_VERIFICATION_FAILED   (ERR_AVB_BASE + 0x008) //0x00108008
#define ERR_AVB_SET_VERITY_FAILED         (ERR_AVB_BASE + 0x009) //0x00108009
#define ERR_AVB_VERIFICAITON_FAILED       (ERR_AVB_BASE + 0x00A) //0x0010800A
#define ERR_AVB_NO_SUCH_PARTITION         (ERR_AVB_BASE + 0x00B) //0x0010800B
#define ERR_AVB_INVALID_OFFSET            (ERR_AVB_BASE + 0x00C) //0x0010800C
#define ERR_AVB_UNINITIAL_PERSIST_VALUE   (ERR_AVB_BASE + 0x00D) //0x0010800D

/* RSA OAEP */
#define ERR_OAEP_INVALID_FORMAT           (ERR_OAEP_BASE + 0x0000)
#define ERR_OAEP_I2OSP_FAIL               (ERR_OAEP_BASE + 0x0001)
#define ERR_OAEP_MGF1_INVALID_SEED_BUF    (ERR_OAEP_BASE + 0x0002)
#define ERR_OAEP_MGF1_INVALID_SEED_BUF_SZ (ERR_OAEP_BASE + 0x0003)
#define ERR_OAEP_MGF1_INVALID_MASK_BUF    (ERR_OAEP_BASE + 0x0004)
#define ERR_OAEP_MGF1_INVALID_MASK_BUF_SZ (ERR_OAEP_BASE + 0x0005)
#define ERR_OAEP_MGF1_MALLOC_FAIL         (ERR_OAEP_BASE + 0x0006)
#define ERR_OAEP_MGF1_HASH_FAIL           (ERR_OAEP_BASE + 0x0007)
#define ERR_OAEP_INVALID_MSG_BUF          (ERR_OAEP_BASE + 0x0008)
#define ERR_OAEP_INVALID_MSG_BUF_SZ       (ERR_OAEP_BASE + 0x0009)
#define ERR_OAEP_INVALID_EMSG_BUF         (ERR_OAEP_BASE + 0x000a)
#define ERR_OAEP_INVALID_EMSG_BUF_SZ      (ERR_OAEP_BASE + 0x000b)
#define ERR_OAEP_MSG_TOO_LONG             (ERR_OAEP_BASE + 0x000c)
#define ERR_OAEP_INVALID_SEED_SZ          (ERR_OAEP_BASE + 0x000d)
#define ERR_OAEP_ZERO_HASH_CHK_FAIL       (ERR_OAEP_BASE + 0x000e)
#define ERR_RSA_OAEP_INVALID_MSG_BUF      (ERR_OAEP_BASE + 0x000f)
#define ERR_RSA_OAEP_INVALID_MSG_BUF_SZ   (ERR_OAEP_BASE + 0x0010)
#define ERR_RSA_OAEP_INVALID_EMSG_BUF     (ERR_OAEP_BASE + 0x0011)
#define ERR_RSA_OAEP_INVALID_EMSG_BUF_SZ  (ERR_OAEP_BASE + 0x0012)
#define ERR_RSA_OAEP_INVALID_KEY_E_BUF    (ERR_OAEP_BASE + 0x0013)
#define ERR_RSA_OAEP_INVALID_KEY_E_BUF_SZ (ERR_OAEP_BASE + 0x0014)
#define ERR_RSA_OAEP_INVALID_KEY_N_BUF    (ERR_OAEP_BASE + 0x0015)
#define ERR_RSA_OAEP_INVALID_KEY_N_BUF_SZ (ERR_OAEP_BASE + 0x0016)
#define ERR_RSA_OAEP_INVALID_KEY_D_BUF    (ERR_OAEP_BASE + 0x0017)
#define ERR_RSA_OAEP_INVALID_KEY_D_BUF_SZ (ERR_OAEP_BASE + 0x0018)
#define ERR_RSA_OAEP_EXPTMOD_FAIL         (ERR_OAEP_BASE + 0x0019)
#define ERR_RSA_OAEP_INVALID_MSG_SZ_BUF   (ERR_OAEP_BASE + 0x001A)

/* PL */
#define ERR_VB_ROM_INFO_NOT_FOUND         (ERR_PL_INFO_BASE + 0x000) //0x00109000
#define ERR_VB_GFH_NOT_FOUND              (ERR_PL_INFO_BASE + 0x001) //0x00109001

/* FASTBOOT */
#define ERR_VB_FB_UNLOCK_KEY_WRONG_LEN    (ERR_FB_SEC_BASE + 0x000) //0x0010A000
#define ERR_VB_FB_UNLOCK_WRONG_KEY_CODE   (ERR_FB_SEC_BASE + 0x001) //0x0010A001
#define ERR_VB_FB_SECDOWNLOAD_NOT_SUPPORT (ERR_FB_SEC_BASE + 0x002) //0x0010A002
#define ERR_VB_FB_PARTITION_NOT_FOUND     (ERR_FB_SEC_BASE + 0x003) //0x0010A003
#define ERR_VB_FB_PARTITION_FORMAT_FAIL   (ERR_FB_SEC_BASE + 0x004) //0x0010A004
#define ERR_VB_FB_VFY_KEY_FAIL            (ERR_FB_SEC_BASE + 0x005) //0x0010A005
#define ERR_VB_FB_PRELOADER_INVALID       (ERR_FB_SEC_BASE + 0x006) //0x0010A006
